import Router from "vue-router"

import vue from "vue"

vue.use(Router)
const router = new Router({
    routes: [
        {
            path: '/',
            redirect: '/home'
        },

        {
            path: '/home',
            name: 'home',
            component: () => import('../pages/home.vue')
        },
		{
			path:'/serach',
			name:'serach',
			component:()=>import('../pages/serach.vue')
		},
		{
			path:'/imgDetails',
			name:'imgDetails',
			component:()=>import('../pages/imgDetails.vue')
		},
        {
            path: '/login',
            name: "login",
            component: () => import('../pages/login.vue')
        },
        {
            path: '/register',
            name: "register",
            component: () => import('../pages/register.vue')
        },
		{
			path:'/personal',
			name:'personal',
			redirect:'/personal/uploads',
			component:()=>import('../pages/personal.vue'),
			children:[
				{
					path:'/personal/uploads',
					name:'uploads',
					component:()=>import('../pages/personalAbout/uploads.vue')
				},
				{
					path:'/personal/collections',
					name:'collections',
					component:()=>import('../pages/personalAbout/Collections.vue')
				}
			]
		},
		{
			path:"/setting",
			name:'setting',
			redirect:'/setting/updataImg',
			component:()=>import('../pages/setting.vue'),
			children:[
				{
					path:'/setting/updataImg',
					name:'updataImg',
					component:()=>import('../pages/settingAbout/updataImg.vue')
				},
				{
					path:'/setting/uploadImg',
					name:'uploadImg',
					component:()=>import('../pages/settingAbout/uploadImg.vue')
				},
				{
					path:'/setting/updataInfo',
					name:'updataInfo',
					component:()=>import('../pages/settingAbout/updataInfo.vue')
				}
			]
		}
    ]
})

export default router

